package com.ynny.chapter04;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/demo01")
public class Demo01Servlet extends HttpServlet {


    @Override
    protected void service(HttpServletRequest request,
                           HttpServletResponse response) throws ServletException, IOException {

        System.out.println("I hava a KFC");

        //寻求 真实 KFC 外卖 帮助
        //服务内部转发

        request.getRequestDispatcher("/demo02")
                .forward(request, response);


    }
}
